package com.villaday.idf.adapter3;

import android.content.Context;
import android.view.View;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.villaday.idf.R;
import com.villaday.idf.base.AbsBaseAdapter;
import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.base.BaseRecyclerViewAdapter;
import com.villaday.idf.model3.ConfigurationsEntity;

public class HomeBatchTopAdapter extends BaseRecyclerViewAdapter<ConfigurationsEntity.BodyBean.MaterialTypesBean> {


    View.OnClickListener onClickListener;
    public HomeBatchTopAdapter(Context context, View.OnClickListener onClickListener) {
        super(context, R.layout.recycle_home_batch_top);
        this.onClickListener = onClickListener;
    }


    @Override
    public void onBindViewHolder(BaseRecyclerViewAdapter.RecyclerViewHolder holder, int position) {
        holder.bindTextView(R.id.tv_hbt, datas.get(position).getName());

        TextView tvHbt = (TextView) holder.getView(R.id.tv_hbt);
        tvHbt.setTag(position);
        tvHbt.setOnClickListener(onClickListener);
        if (datas.get(position).isCheck()) {
            holder.getView(R.id.iv_hbt).setVisibility(View.VISIBLE);
        } else {
            holder.getView(R.id.iv_hbt).setVisibility(View.INVISIBLE);
        }
    }
}
